#ifndef _FPGA_COMMON_H_
#define _FPGA_COMMON_H_

// 其他除FPGA的外设接口
struct misc_if
{
    char *name;
    void (*pfun_test)(int a);
    int (*pfun_getChargeState)(int *chargeState1, int *chargeState2, int *externalPowerSupply);
    int (*pfun_getBatteryPower)(int *power1, int *power2);
    int (*pfun_get_bat_vol)(double *power1, double *power2);
    int (*pfun_getTemperature)(int *data);
    int (*pfun_get_temp_vol)(float *data);
    int (*pfun_setLCDBrightness)(int brightness);
    int (*pfun_setBacklightTime)(int backlightTime);
    int (*pfun_setBacklightAlwaysOn)(void);
};
struct misc_dev
{
    struct misc_if *interface;
};

#define DEFAULT_MISC_IF \
    .name = "this-unname" /* 防止忘记命名 */

// 		.pfun_probe = none_probe, .pfun_release = none_release, \
	// .pfun_suspend = none_suspend, .pfun_resume = none_resume,       \
	// .pfun_start      = none_start,                                  \
	// .pfun_read_frame = none_read_frame,                             \
	// .pfun_read_regs  = none_read_regs,                              \
	// .pfun_write_regs = none_write_regs,                             \
	// .pfun_isfinish = none_isfinish, .pfun_stop = none_stop,         \
	// .pfun_dump = none_dump, .pfun_version = none_version,           \
	// .pfun_set_gpio = none_set_gpio, .pfun_get_gpio = none_get_gpio

int misc_if_unregister(char *name);
int misc_if_register(struct misc_if *interface);
#endif